﻿CREATE TABLE [dbo].[arhAngajatiSalarizare] (
    [IDAngajatSalarizare] INT             IDENTITY (1, 1) NOT NULL,
    [IdPersoana]          INT             NOT NULL,
    [DeLaData]            DATETIME        DEFAULT (getdate()) NOT NULL,
    [Salar]               INT             NOT NULL,
    [IDDepartament]       INT             NOT NULL,
    [IdTipGrad]           INT             DEFAULT ((0)) NOT NULL,
    [OreNorma]            SMALLINT        DEFAULT ((0)) NOT NULL,
    [FractiuneNorma]      DECIMAL (5, 2)  DEFAULT ((1)) NOT NULL,
    [PanaLaData]          DATETIME        NULL,
    [NormaBaza]           BIT             DEFAULT ((0)) NOT NULL,
    [ServiciiPeChitanta]  BIT             NULL,
    [CodUnitate]          SMALLINT        DEFAULT ((0)) NOT NULL,
    [Clasa]               SMALLINT        DEFAULT ((0)) NOT NULL,
    [Grupa]               VARCHAR (20)    NULL,
    [IDJurnal]            INT             NULL,
    [SalarFunctie]        DECIMAL (18, 2) DEFAULT ((0)) NOT NULL,
    [Marca]               INT             NULL,
    [NrContract]          VARCHAR (20)    NULL,
    [DataContract]        DATETIME        NULL,
    [TipContract]         INT             NULL,
    [PerioadaDeterminata] BIT             NULL,
    [Observatii]          VARCHAR (250)   NULL,
    [DurataContract]      FLOAT (53)      NULL,
    [Luna]                SMALLINT        NOT NULL,
    [Anul]                SMALLINT        NOT NULL,
    CONSTRAINT [PK_arhAngajatiSalarizare] PRIMARY KEY CLUSTERED ([IDAngajatSalarizare] ASC),
    CONSTRAINT [FK_arhAngajatiSalarizare_DEPARTAMENTE] FOREIGN KEY ([IDDepartament]) REFERENCES [dbo].[Departamente] ([IDDepartament]),
    CONSTRAINT [FK_arhAngajatiSalarizare_Jurnale] FOREIGN KEY ([IDJurnal]) REFERENCES [dbo].[Jurnale] ([IDJurnal]),
    CONSTRAINT [FK_arhAngajatiSalarizare_Persoane] FOREIGN KEY ([IdPersoana]) REFERENCES [dbo].[Persoane] ([IdPersoana]),
    CONSTRAINT [FK_arhAngajatiSalarizare_TipContracte] FOREIGN KEY ([TipContract]) REFERENCES [dbo].[TipContracte] ([TipContract]),
    CONSTRAINT [FK_arhAngajatiSalarizare_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

